<template>
  <n-grid cols="2 s:2 m:2 l:3 xl:3 2xl:3" responsive="screen">
    <n-grid-item>
      <n-form :label-width="90"  ref="formRef" label-placement="left">

        <n-form-item label="学号：" v-if="desc=='student'">
          {{userInfo.SID}}
        </n-form-item>
        <n-form-item label="工号：" v-if="desc != 'student'">
          {{userInfo.TID}}
        </n-form-item>
        <n-form-item label="班级：" v-if="userInfo.claseName">
          {{userInfo.claseName}}
        </n-form-item>
        <n-form-item label="专业："  v-if="desc=='student'">
          {{userInfo.majorName}}
        </n-form-item>
        <n-form-item label="学院：">
         {{userInfo.academyName}}
        </n-form-item>
        <n-form-item label="职务：" v-if="desc!='student'">
          <n-text v-if="userInfo.job==0">课程管理员</n-text>
          <n-text v-if="userInfo.job==1">教师</n-text>
         </n-form-item>
      </n-form>
    </n-grid-item>
  </n-grid>
</template>

<script lang="ts" setup>
import {  ref, onMounted } from 'vue';
import { getMyInfo } from '@/api/system/user'
import { useUserStore } from '@/store/modules/user';

const userStore = useUserStore();
const { desc: desc } = userStore?.info || {};
const userInfo:any = ref({});


onMounted(
  async () => {
    userInfo.value = await getMyInfo();
  })


</script>
